//
//  FriendListModel.swift
//  Swift-TableView-Example
//
//  Created by Bilal ARSLAN on 11/10/14.
//  Copyright (c) 2014 Bilal ARSLAN. All rights reserved.
//

import Foundation
import UIKit
import Alamofire

class FriendListModel : UITableViewCell {
    
    @IBOutlet weak var PortailUrl: UIImageView!
    @IBOutlet weak var PlateNumber: UILabel!
    @IBOutlet weak var MsgText: UILabel!
    
    var BaseimageUrl = "http://imgfm.qichexiaozi.com/"
    
    func configurateTheCell(friend: Friend) {
        self.PlateNumber?.text = friend.PlatNumberStr
        
        let imageUrl = BaseimageUrl + friend.PortailUrlStr
        
        Alamofire.request(.GET, imageUrl).response() {
            (_, _, data, _) in
            self.PortailUrl.image = UIImage(data: data! as NSData)
        }
        
        self.MsgText.text = friend.MsgTextStr

        
    }
    
}